package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the GROUPNEST database table.
 * 
 */
@Embeddable
public class GroupnestPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String groupname;
	private String memberof;

    public GroupnestPK() {
    }

	@Column(unique=true, nullable=false, length=10)
	public String getGroupname() {
		return this.groupname;
	}
	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	@Column(unique=true, nullable=false, length=10)
	public String getMemberof() {
		return this.memberof;
	}
	public void setMemberof(String memberof) {
		this.memberof = memberof;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof GroupnestPK)) {
			return false;
		}
		GroupnestPK castOther = (GroupnestPK)other;
		return 
			this.groupname.equals(castOther.groupname)
			&& this.memberof.equals(castOther.memberof);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.groupname.hashCode();
		hash = hash * prime + this.memberof.hashCode();
		
		return hash;
    }
}